package com.sf.fy.uav.applet.controller;

import com.sf.fy.uav.common.request.user.UserCompanyEditReq;
import com.sf.fy.uav.common.request.user.UserCompanyReq;
import com.sf.fy.uav.common.utils.Rs;
import com.sf.fy.uav.user.controller.UserCompanyRest;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户额外信息表 前端控制器
 * </p>
 *
 * @author LTQ
 * @since 2024-05-31
 */
@RestController
@RequestMapping("/sys/user-company")
public class UserCompanyController {


    @Autowired
    private UserCompanyRest userCompanyRest;

//    public UserCompany getByUserId(String userId) {
//    }

    @Operation(tags = "添加公司", description = "添加公司")
    @PostMapping("add")
    public Rs<Void> add(@RequestBody UserCompanyReq userCompanyReq) {
        userCompanyRest.add(userCompanyReq);
        return Rs.success();
    }

    @Operation(tags = "编辑公司", description = "编辑公司")
    @PostMapping("edit")
    public Rs<Void> edit(@RequestBody @Valid UserCompanyEditReq userCompanyEditReq) {
        userCompanyRest.edit(userCompanyEditReq);
        return Rs.success();
    }

}
